import request from '@/utils/request'
/**
 * 获取订单列表
*/
export const getOrderList = (params) => {
  return request({
    url: '/employ/order/list',
    method: 'get',
    params
  })
}

/**
 * 查询订单
 */

export const queryOrder = (params) => {
  return request({
    url: 'sys/goodsExchangeData/list',
    method: 'get',
    params
  })
}

export const getOrderDetailById = (id) => {
  return request({
    url: `/employ/order/info/${id}`,
    method: 'get'
  })
}

export const deleteOrder = (id) => {
  return request({
    url: `/employ/order/deleteOrder?id=${id}`,
    method: 'get'
  })
}

/**
 * 发放状态回调的刷新
 * */
export const refreshStatus = (orderId) => {
  return request({
    url: `/employ/order/refreshStatus?orderId=${orderId}`,
    method: 'get'
  })
}

/**
 * 编辑商品
*/
export const updateOrder = (data) => {
  return request({
    url: `/employ/enterprise/update`,
    method: 'post',
    data
  })
}

/**
 * 下载发放订单
*/
export const exportOrderList = (data) => {
  return request({
    url: `/employ/order/exportList`,
    method: 'get',
    data
  })
}

/**
 * 下载发放订单
*/
export const downloadOrderModel = (data) => {
  return request({
    url: `/employ/enterprise/update`,
    method: 'get',
    data
  })
}

/**
 * 上传
*/
export const uploadOrderList = (data) => {
  return request({
    url: `employ/issuedUser/importExcel`,
    method: 'post',
    data
  })
}

/**
 * 导出
 * */
export const exportList = (data) => {
  return request({
    url: `employ/order/exportList`,
    method: 'get',
    data
  })
}

/**
 * 删除file
 */
export const deleteFile = (data) => {
  return request({
    url: `employ/order/deleteFile`,
    method: 'post',
    data
  })
}

/**
 * 上传订单到税源地平台
 */
export const uploadToTax = (orderId) => {
  return request({
    url: `employ/order/uploadToTax?orderId=${orderId}`,
    method: 'GET'
  })
}
